package com.zxl.designpattern.structure.composite;


/**
 * @author zxl
 * @version 1.0
 * @description 组合模式-叶子组件
 * @date 2025/6/1 14:22
 */
public class Employee implements OrganizationComponent {
    private String name;
    private String position;

    public Employee(String name, String position) {
        this.name = name;
        this.position = position;
    }

    @Override
    public void displayInfo() {
        System.out.printf("员工: %s, 职位: %s%n", name, position);
    }

    @Override
    public int getEmployeeCount() {
        return 1;
    }
}